improve methodEquals by using visitor API