Various performance optimizations