refactored command to abstract command