more consistent use of locking