enhanced codegen