Refactored
Optimized queries for not getting all data at once, splitted them
Merge branch 'master' of http://github.com/samsonos/cms_app_material