removing some unnecessary memory allocations