refactor ThreadID type