Add static generator

Close #163
Could you add a comment outlining that? Perhaps a common function could be useful too. Sorry that I wasn't as on the ball with my code review.