moving search related functionality out of util and into its own module