global detect_xxx utilities.