Refactor SearchController