Refactoring "raw" pointers to smart pointers (WIP Commit 1)