refactored retrier