changed structure of balancing template