improve implementation of the multithreading manager