an implementation without using config to share state