Refactoring the code for updating the reconciliation state