rebuild tree layout