this class is probably good enough to be put outside of the class and reused for other detectors.