Refactor to use make use of inner state monad piping

(Rather running the stateT transformer for each coroutine)