replace common pointer with shared_ptr