Reorg javascript