javascripts restructured