Extracted a boolean expression to a named method,

in order to make the code marginally more readable.