Removed RefCounter by replacing with shared_ptr.