I think we can use your `extend` function here