minor refactoring: reused IsOfType<>() extension