Reduce usage of commandShell global by assigning it to a local