Improve JS performance