Register the generator via a module and use closure param injection.