More perliminary reworking for threading