Fix code generation
improve code generation