Small refactoring of TaskCommand and Command