Remove some needless memory allocations