I don't get the workflow here, the mergeDefaultMetadata should return an array, and the setContentType too, the class must be stateless