Refactored RateLimiter to use a better interface.