Remove redundant calls of java.lang.Class methods. Replaced with object instanceof.