modify type builder for class to support protocol