Minor refactoring to the base generator