Refactor search page