used terser ternary syntax