refactor clean exit strategy