refactored views and index