It would be nice to move this into a Util class in "core" so that it's available more broadly.