ternary operator fancy boolean expression and if