refactoring: created function with code that remove old cache files