clean up file io a little