Move search out to separate controller and template