generalized the resource decorator