Restructured ifelse to more closely match its emitted form.