Refactoring TrainParser