Refactored resourceSpec