refactor the detail page