[REFACTORING] handling commands using a chain of responsibility