migrating to use std::unique_ptr