Avoid exit in code and better use of Sf2 command

| Q                   | A
| ------------------- | ---
| Bug fix?            | No
| New feature?        | No
| BC breaks?          | No
| Tests pass?         | Yes
| Scenarios pass?     | Tested with installation and import/export
| Checkstyle issues?  | No
| Changelog updated?  | N.A.
| Fixed tickets       |
| Doc PR              |