functional thread setup