Assorted optimizations