Refactor the 'searches' controller