I think you could single line this as ternary.