search route refactored