refactoring execution des commandes