Add class detection