Enhanced to generate internal protocol classes.