see comments in ProviderBasedGenerator