double ternary operator, really hard to read