refactor: reduce complexity of execute_safe_output in src/execute.rs
#307
+127
−185
execute_safe_output in src/execute.rs
#307