#2 added interface for generators