Moved thread classes to own file