cleanupTraining method