Slight search refactoring