Optimized Implementation