Refactored non-field errors in templates