Changed codegen logic.