More thread safety work