Refactored how errors are displayed