Optimizations and simplifications.