More refactoring around the I/O model