update code generator and templates