Refactored views.index