Restructure JS files