refactor search type