Refactor chat example application finish