Maybe the name of this should be changed to reflect what it does, not where it's used.  And needs a docstring.