Scanner to detect class