A number of optimizations