refined ternary statement with AND Logical operator instead of OR Logical operator.