Improve js performance