shifted from raw ptrs to shared_ptrs