Refactoring searches to be cleaner