replacing Method with Func mechanically