Detect class name with reflection