Some performance optimizations