refactor count_tag in async