Refactored the BaseCommand class.