clean up some locking code, + continue refactor SharedData