Split out from #174
Split out from #174