add common generator helpers.
Merge pull request #283 from stephenplusplus/common

add common generator helpers.