Moved threads to their own classes.