Refactored search tests