Avoid mutually exclusive checks

This splits one check into two to avoid unneeded computations and mutually exclusive checks.