restructure file organization
split out cache file logic into lib