Refactored searchbox