Optimized iteration