Seems like a useful function. Wouldn't you consider this as a general function and find another home for it?