Refactor search methods.