Optimized JS codes