Make conditional more concise with ternary operator per CR feedback.