what is the better way of finding if branch exists