refactor LoadBalancerImpl class to use Stream API.