threading rework to make it less of a train wreck