This naming is confusing.  Maybe rename `attempts` to `max_attempts`?