Moved search into its own file