Optimized algorithms