Move shared code in subtree