search tests refactoring