refactoring recover_cache() in TODO