more refactor for regression tree partition