Code refactoring in iris.Resource