We use f-template and string replacement for the code gen process, which brings in a lot of difficulty in reviewing and implementing new features. Developers needs to explicitly track the indentations. Writing a jinja2 template can alleviate from handling the indentation inline. In addition, it provides features like loops and conditionals which I expect should greatly reduce the complexity in codegen.