separated generator logic