Refactored resource creation