Changed code generation method