Optimized solution