This is a generally useful utility.