refactored up the search helper a bit