Added generator classes and tweaked templates.