Switched over to using shared_ptr