streamline the definition of runCommandHandler