Moved IO into it's own class
Refactored handler to use new IO class