Move TempFileRepo to a separate file