refactoring searches and more controller tests