finished refactoring detail view