Return a std::unique_ptr to make the ownership explicit.