refactoring dalgenerator