factored sudo to calling script