Added javascript specific optimizations