wrapped all the genration processes into a generator