Optimized memory usage