search feature refactoring