Threading rewrite.