using deleteBranch instead of Delete so that we dont use too much memory