Small improvement to toggling threads