extracted search functionality to a partial