allow the flashproxy to be restarted in error case (+ refactorings)