Refactoring error message display