refactor thread program article