Refractor to proper MVC