refactoring of generator output