Refactored IOController for better structure.