Clean up resource handling