tristate confirmation management with buttons and some small optimizations