Refactored Search Query