restructured new JS file