refactoring and throttle