Reorganized controls and split into two threads