Refactored cont_monad