nit: either use `!threads.length` or `threads.length === 0`, I don't like non-strict equality ;)