improve throttling, code cleanup
improve throttling