Improved generator readability.
Cleaned up generator code.