refactoring and added svm.