DRY-refactor search form