Refactor : improve total count command