Refactoring server logic to handle Player creation and socket creation