refactor resq_wrapper