sampling and response handling code removed since it needs an overhaul