Reduced nested conditional to compound expression

GitHub edit - wait for CI.