Refactor search. Change only when needed.