Refactor generation methods
Merge pull request #13 from Cinamonas/bugfix-generate-refactor

Refactor generation methods