State monad type definition simplified in relation to its factory