minor edit to consolidate search function