generating nested types