more efficient way to run commands, and support for more shells