Refactored error display