Refactored architecture to be more MVC