refactoring Search into its own entity