Refactored the maybe monad.