Generation should be OK
Not tested enough though...
the old code is easy to plug back (uncomment the new)
Code generation looks OK though indentation is horrible...