Counter helpers

I refactored some of the logic for managing counters into a helper, so that it would make our controllers more flexible to changes in how we may choose to manage counters.