cleanup
improve training set builder