Neater way of handling the sudo problem