refactor search page