clean up and reduce size of internal pthread structure