Could you add a comment about the impact of setting the threadlocal here/what it's intended to do?