refactor search form