Revert "[4.0] Change raw pointer to unique_ptr"