Clean up register_service.