Optimizations to reduce new objects allocation.