Improve Generator Class

Improve Generator Class