More JS optimizations