Refactored rate-limit check
Merged