Reduce repeated allocations and conversions