Should ``metadata`` be ``opts`` here?