We should consider if it's possible to avoid all of this transforming entirely, but at least for now, do it all in one place by having an available helper.