New optimized code