refactor chat
refactor javascripts