Substituted naked pointer by shared_ptr