Generator code cleanup