replace tree model