continue refactoring TrainData and Bayesian classifier