Javascript so easy restructure