Remove unnecessary allocations