Moved to Data Struct

moved a couple of things to the data structure so they do not leave
scope and can be reached by the thread