Improve multithreading