Refactor searching out into its own method