Cache count refactored