chat code complete clean-up