refactored IO module and IO test