Refactoring a bit of the cache clear code here.