Generator refactor.