more stuff split out from #9109