another io refactor