Refactor some methods in controller and model
Merge branch 'master' of git://github.com/gabrielliwerant/abrightcms_core