Refactored controllers and views.