setting generator, cleanup