Reorganized MVC structure and code