refactored ResourceOptions handling.