move pending counter to visitor to decouple