update logic for different training methods