refactor kinect logic