Use std::unique_ptr to make the ownership explicit.