Avoid one closure creation when calling isMethod.