Modularized the chat server