Refactored IO