Restructured the files containing the thread classes