use shared_ptr a little more thoroughly