WeakPersistent handling: Refactored for clarity.