safer get_filecache
refactor repo updating code