change to use of smart pointers