Changed structure of code generation