refactoring error message handling - 12 - done