Reorganize javascripts