these 3 calls should be atomic, to match more closely what happens in production