Initial framework for detection (filtering, mostly)