use forward declaration for RefCount and fix name clash ref_count() vs ref_count