It's a little unusual to move the IO object into the state.  Conceptually, it really isn't part of the state.  I would suggest moving it back out into the functions.