This function deserves a more descriptive name + documentation, IMO. It's unclear what it does, from the outside.