Convert execute shell parts to macros and unify parameters