Moving the common code of increment and decrement of cache file store into seprate function