Removed allocations and unneeded variables