Refactor server code and clean up lobby/gameroom removal logic.