Detection related stuff.