Separate generator into its own class
Fix references