push more functionality out of fileio