basic monad and registry code