upgrade code generation