Connect views to controllers and refactor some controllers.