Optimization of JS code.