Moved non-shared memory specific code away.