Quantity and derived classes