Various optimizations;