refactoring error message handling - 10 - almost done