Refactoring for different io device support