Breaking if-clause into two to improve readability