resourceExtract refactoring