Refactored round robin generator to use a block