Refactors JS
Slows transitions up a bit