refactors io tests and changes io implementation