re-organizing js