Refactoring search test