Revert "simplify the conditionals"

This reverts commit 42cf22129e4cc334d8fbb54ee42edb3021ac7357.

I'm not sure this patch doesn't change the existing behaviour.