Implemented the retrieval of the response if the step failed.
Refactoring