Change sudo commands

Run as little as possible under sudo