Refactored views and controllers and models