refactor chat
Merge branch 'sora' of https://github.com/ruinakata/sora into sora
merging changes with Rui.
finish refactorin. Fix #1
Fixes #1