Factors out THRESHOLD to shared_details.h