Restructure the js files