Updated resource handling
Cleaned up resource handling