refactor app MVC