Eliminated some unnecessary memory allocation