You could extract the onFailure to a private method