Optimization for jquery.