Abstracting error monad a bit