refactored views and controllers