Better detection of classes