moved height update and rebalance mechanism to separate method