refactored use_external_resource method