refactor MVC example