refactor search terms method