[codegen] use private codegen