I think my previous comment got lost, but as a minor thing here, can use common code for callbacks for servers and segments