refactoring error message