Optimized script.