Revert "optimised JS"

This reverts commit 7c3d3eed4787136a278ba7404a9d5b67d26d4055.