refactoring of class checking ok an external method