refactoring command base