Looks like a useful utility class that we should be advertising more widely.