simplify and correct logic to pass weight to balancer algorithms
(cherry picked from commit 529417f86c4d568ec014de0092217a9f63dfbc14)