Simplify detect.