work on some threading issues in Kinectdevice, refactoring