This is a generic utility function, no need to make it part of a class (ie, no use of self or local state).