Optimized script