Reorganize common javascripts