refactor date_range.count