This block is unnecessarily complicated. Use a single boolean expression.