refactor out file cache