Modify new/delete to shared_ptr