refactor search bar