`mlcube run` function is too long and complex right now, needs to be refactored (without behavior change)
mlcube runfunction is too long and complex right now, needs to be refactored (without behavior change)