refactored search form