Collapsed search functions into a single one.