Potential perf optimizations by reducing allocations