externalize error message computation