Explicit check for ClassDefinition when adding method calls