More elegant code generation. Improved generated code