Added macro-logic to code generation