convert to ternary operator