Refactor to be more MVC