switch to ternary operator