Preliminary changes before refactoring.
STEP_SUCCESS and STEP_FAILURE may have been erroneously swapped in the previous version