Rework javascripts