Refactored search bar