Improved custom resource handling