Use std::unique_ptr to manage memory. No functionality change.