better isMethod parsing