- The three steps of modifying services in the target system do basically the same thing, so factor out the loops and logging into a systemctl() function. - Log to warning() instead of just debugging, on failure.