improve base type generator