cleaned chat views code