Updated generation logic
Moved fs to proper place