use method_defined? instead of testing the array of instance_methods