io classes refactoring