refactor SearchQuery