Optimization improvements