Reorganized javascripts