Remove duplication from search controller