Add RefCount and replace old api