code formatting
Refactored generator