refinement lua call added and rebalancing