refactor search module