refactored and fixed a lot of stuff around the chat system and impersonation handling