refactoring detail view