replaced ternary for readability