Clean up chat.js