Extracted the create_rserver function.