Optimize type-info-impl and type-registry-impl