refactor has() and hasCount() to use getBranch()