improve generation speed
resolve warning
Merge pull request #306 from dennishendriksen/master

Improve generation performance