refactored search form and tests added