Command refactoring