Upgrade Generator to create folder and reduce code