some tinkering with detection class