generator cleanup