webchat: still refactoring