Code cleanup
Code cleanup
Refactored Generate method