refactoring for IOUnit done; also refactored some related parts