Remove dependency on shared_ptr.