Move some threading stuff to the manager