refactoring chat, vote, clear data