Refactor search bar class.