reorganization of stuff into fileio class