refactor MVC