refractor javascripts