Create generator class, fix a few things