improve to use cache file and dir list