refactor MVC structure