revert code re-ordering