Some refactoring of a couple IO classes.