Refactoring: raw pointer -> unique_ptr