Refactor room server.