refactor generation to a new class
Merge pull request #1 from benolee/refactor-generation

refactor generation to a new class