small refactor to search spec