improve condition computation