I will not complain if you make it an internal utility function that is not exposed as API. (Well, I'll complain a little, but I will still merge it.)