refactor chat to not be a singleton