Reorganise JS files