make threads code clear