Added classes that supports n threads.