allow cleanup to be NULL
just bail if we don't have primitives