reorganzing js