Refactoring of LogisticRegression classes