Restructure js files