Fix factor split funciton so that it can handle well even the levels but without actual values corresponding to it. And add a function for multiple factor split.