move the code of the Thread inheritor to a separate file