refactored search1