refactor detail and results view