Refactorings
Moved generator to its own JS file