update ref-history-count related code