Refactoring and simplifying search_test.