refactoring generator classes