Replace dictionary instead of locking and updating