move some safe operations out of synchronization