Refactored base classes for commands.