smart_ptr cleanup