Add clean threads method (maxThreads)