refactored CommandExecutor