replace raw with unique pointer