I think this subsumes #1737