Better handling for generic types. Added some classes in the generator.py to organise code.