Refact the code to adjust the changed work flow.