tweaked class checking