Eliminate duplication in drawBranch