Now that this has been promoted to a top-level function its name should be prefixed with an underscore and moved up top to the "Internal helper functions" section.