Minor performance improvement, avoiding memory allocations every time and allocating the memory with the process directly for the foreign nodes