refactoring for svm regions