refactor detail view