remove dependency on `methods` pkg