Code generation with templates (2012)