Adding generic support to the counter

This makes the counter more useful and specialized