Optimizations and improvements.