remove some unused code
simplified runloop a bit