refactoring cache dir cleaner