pull doc count into it's own function

while I have yet to figure out how to improve that, I did find that I wanted to do this every time