revision of HOSECodeGenerator from CDK