refactoring Command