can't this somehow be shared between this and the `Key` impl