Big refactoring into MVC structure