Refactored to work with resourceNode