added some class checking utils