WriterMonad to help clean up error handling.