If we are extracting the `optionalKey` into a configAPI concern as mentioned, then we'll need to handle that here, but should still be quite a bit simpler