Added support for branching in the classification process