DistributedThreadTests refactored