Added detail view and refactored code organization