Refactored ErrorHelpers.