validate class type in hybridforest
improve the coding style