ChatServer: Separated server logic from application logic
ChatServer: refactoring