DRY up count, it's used for both index & type