Refactor module by abstracting over `IO` monad using `MonadIO` typeclass.