allocation optimizations for immutable collections