code refactor, separate the ZeroZBranch and SmallZBranch concept