improve methodswith for #5067