Refactor to handle failures
Merge branch 'MH-1008' into dev