remove unnecessary memory allocation.