compose_retries implemented

It combines multiple `can_retry` function to a single function