Optimized usage of commands

partly addresses #270