Train.hs Code restructured to remove redundacies