non-functional change: invert logic to make code easier to read