Simplifying searchbar code.