restructured js