Change the way cacheGenerator worker objects are initialized

This will help us to test it in future, when several other stages are added. to test the generator