DRYed searching functions.