Generalized some of the searching