refactor MonadGlue