Avoid complicated ternary operator