Revert "Attempt js optimization 1"

This reverts commit a68f5db0df32181cf68afa78529091677e2a77d1.