Refactoring of the condition for comment and the error-comment view