Simplify computation of bases metadata for duetto
Simplify generation of downcasts on duetto