Improve abstraction of ref lock/write.