add the ternary operator to reduce to a single line