Move regular generation into its own function.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>