Improve conditional handling