Code cleanup for rebalancer.