Remove crazy sudo keep-alive thing. It's useless.
Move sudo stuff to the very end, where possible.