Slightly refactored methods

constaining checking a generic type.