Better management of control thread