Introduce a generator interface and implement it