Move shared I/O functions to parent classes.