refactored exec and scp