ENH: Using WeakPointer to make sure we don't use dangling pointers