much io refactoring