Rework ternary