router/elb: refactored the way to get the elb endpoint.