Putting generator into a class.