Move sudo and background logic to under requires