Refactor rule's span to use isolated memory