Remove nested ternary operators