minor refactoring.  FileIO could be different, but I'm not using at the moment.