polishing of the chat window ui, code cleanup