Add crude implementation of handling shared state