Simplify by using cmd.script