Avoid keeping global state in the decorator, as this breaks test
isolation.  Instead keep it in the registry.