Rewrite, better structure, Threading