Exhibit 10.4

# AMEREN CORPORATION
SYSTEMNON-REGULATED SUBSIDIARYMONEY POOL AGREEMENT

This
NON-REGULATED SUBSIDIARY MONEY POOL AGREEMENT(this Agreement) is made
and entered into this 27th day of February, 2003 by and among Ameren Corporation
(Ameren), a Missouri corporation and a registered holding company under the
Public Utility Holding Company Act of 1935, as amended (the Act); Ameren
Services Company (Ameren Services), Ameren Energy, Inc., and
Ameren DevelopmentCompany, each a Missouri corporation and subsidiary company of
Ameren; Ameren ERC, Inc., and Ameren Energy Communications, Inc., each a
Missouri corporation and subsidiary company of Ameren Development Company; CILCORP
Inc. (CILCORP), Ameren Energy Resources Company and CIPSCO
Investment Company, each an Illinois corporation and a subsidiary of Ameren; Ameren
Energy Development Company, Ameren Energy Marketing Company, Ameren Energy
Fuels and Services Company, and Illinois Materials Supply Co., each an Illinois
corporation and a subsidiary of Ameren Energy Resources Company; Ameren Energy
Generating Company, an Illinois corporation and a subsidiary of Ameren Energy
Development Company; AFS Development Company, LLC, an Illinois limited liability
company and a subsidiary of Ameren Energy Fuels and Services Company; Union Electric
Development Corporation, a Missouri corporation and a subsidiary of Union Electric
Company, which is a subsidiary of Ameren; CILCORP Investment Management Inc.,
CILCORP Ventures Inc., and QST Enterprises Inc., each an Illinois
corporation and a subsidiary of CILCORP; CILCORP Energy Services Inc., an Illinois
corporation and a subsidiary of CILCORP Ventures Inc.; Central Illinois Generation,
Inc., CILCO Exploration and Development Company, and CILCO Energy
Corporation, each an Illinois corporation and a subsidiary of Central Illinois Light
Company, which is a subsidiary of CILCORP; AES Medina Valley Cogen (No. 4), L.L.C.
(AES Medina Valley), an Illinois limited liability company and a subsidiary of
Ameren Energy Resources Company; AES Medina Valley Operations, L.L.C. and AES
Medina Valley Cogen (No. 2) L.L.C., each an Illinois limited liability company and a
subsidiary of AES Medina Valley; and AES Medina Valley Cogen, L.L.C., an Illinois
limited liability company and a subsidiary of AES Medina Valley Cogen (No. 2) L.L.C. (each
a Party and collectively, the Parties).

RECITALS

WHEREAS,
Ameren and certain of the Parties named above are parties to the Ameren System Amended and
Restated Non-Utility Money Pool Agreement, as amended from time to time through September
7, 2002, pursuant to which Ameren and participating subsidiaries make contributions from
time to time to the money pool in order to coordinate and provide for the short-term cash
and working capital requirements of participating subsidiaries;

WHEREAS,
in accordance with the authorization of the Securities and Exchange Commission under the
Act, Ameren acquired all of the issued and outstanding common stock of CILCORP, effective
January 31, 2003, and, in conjunction therewith, also acquired all of the membership
interests in AES Medina Valley;

WHEREAS,
in conjunction with the acquisition of CILCORP and AES Medina Valley, Ameren wishes to
restate and replace the Amended and Restated Non-Utility Money Pool Agreement, as amended,
in order to add CILCORP, certain direct and indirect subsidiaries of CILCORP, and AES
Medina Valley and its direct and indirect subsidiaries as money pool participants in order
to coordinate and provide for their short-term cash and working capital requirements;

NOW
THEREFORE, in consideration of the premises, and the mutual promises set forth herein, the
Parties hereto agree as follows:

ARTICLE ICONTRIBUTIONS AND LOANS

Section
1.1 Contributions to Non-Regulated Subsidiary Money Pool. Each Party will determine
each day, on the basis of cash flow projections and other relevant factors, in such
Partys sole discretion, the amount of funds it has available for contribution to the
Non-Regulated Subsidiary Money Pool, and will contribute such funds to the Non-Regulated
Subsidiary Money Pool. The determination of whether a Party at any time has surplus funds
to contribute to the Non-Regulated Subsidiary Money Pool or shall contribute funds to the
Non-Regulated Subsidiary Money Pool will be made by an appropriate officer of such Party,
or by a designee thereof, on the basis of cash flow projections and other relevant
factors, in such Partys sole discretion. Each Party may withdraw any of its funds at
any time upon notice to Ameren Services as administrative agent of the Non-Regulated
Subsidiary Money Pool. No contributions to the Non-Regulated Subsidiary Money Pool will be
made by Ameren Services.

Section
1.2 Rights to Loans. (a) Subject to the provisions set forth in this clause (a) and
in Section 1.4(b) below, all short-term borrowing needs of the Parties, with the exception
of Ameren and CILCORP, may be met by funds in the Non-Regulated Subsidiary Money Pool to
the extent such funds are available. Each Party (other than Ameren and CILCORP) shall have
the right to request loans from the Non-Regulated Subsidiary Money Pool from time to time,
subject to the availability of funds and the limitations and conditions set forth herein.
Each Party (other than Ameren and CILCORP) may request loans from the Non-Regulated
Subsidiary Money Pool from time to time during the period from the date hereof until this
Agreement is terminated by written agreement of the Parties; provided, however, that the
aggregate amount of all loans requested by any Party hereunder shall not exceed the
borrowing limits set forth in any applicable orders of the Securities and Exchange
Commission and other regulatory authorities, resolutions of such Partys shareholders
and Board of Directors or similar governing body, such Partys governing corporate
documents, and agreements binding

2

upon such Party. No Party shall be obligated to borrow
from the Non-Regulated Subsidiary Money Pool if lower cost funds can be obtained from
external borrowing. No loans through the Non-Regulated Subsidiary Money Pool will be made
to, and no borrowings through the Non-Regulated Subsidiary Money Pool will be made by,
Ameren or CILCORP.

(b)    
          Subject to receipt of any necessary regulatory approval, other non-regulated
          affiliates of Ameren may enter into this Agreement under the same terms and
          conditions by amendment executed by the affiliate and Ameren Services as
          administrative agent.

Section
1.3 Source of Funds. (a) Funds will be available through the Non-Regulated
Subsidiary Money Pool from the following sources for use by the Parties from time to time:
(i) surplus funds in the treasuries of Parties other than Ameren Services (Internal
Sources), and (ii) proceeds from commercial paper issuances, bank borrowings or
other external borrowing arrangements by Parties other than Ameren Services
(External Sources), in each case to the extent permitted by applicable laws
and regulatory orders. Funds will be made available from such sources in such order as
Ameren Services, as administrative agent of the Non-Regulated Subsidiary Money Pool, may
determine will result in a lower cost of funds to Parties borrowing from the Non-Regulated
Subsidiary Money Pool, consistent with the individual borrowing needs and financial
standing of the Parties contributing funds to the Non-Regulated Subsidiary Money Pool.

(b)    
          Borrowing Parties will be deemed to have borrowed pro rata from each Party that
          has contributed funds to the Non-Regulated Subsidiary Money Pool in the
          proportion that the total amount then contributed to the Non-Regulated
          Subsidiary Money Pool by such Party bears to the total amount then contributed
          to the Non-Regulated Subsidiary Money Pool by all Parties. On any day when more
          than one source of funds (e.g., funds from Internal Sources and funds from
          External Sources), with different rates of interest, are used to fund loans
          through the Non-Regulated Subsidiary Money Pool, each borrowing Party will
          borrow pro rata from each such source of funds in the Non-Regulated Subsidiary
          Money Pool in the same proportion that the amount of funds provided by that
          funding source bears to the total amount of short-term funds available in the
          Non-Regulated Subsidiary Money Pool.

Section
1.4 Authorization. (a) Each contribution to the Non-Regulated Subsidiary Money Pool
shall be authorized by the contributing Partys President, Treasurer, or Assistant
Treasurer, or by a designee thereof.

(b)    
          All borrowings from the Non-Regulated Subsidiary Money Pool shall be authorized
          by the borrowing Partys President, Treasurer, Assistant Treasurer, or by a
          designee thereof. Disbursement requests signed by a Partys President,
          Treasurer, Assistant Treasurer, or designee thereof shall be considered as
          authorization for borrowing hereunder.

3

Section
1.5 Interest. Each Party receiving a loan shall accrue interest monthly on the
unpaid principal amount of such loan from the Non-Regulated Subsidiary Money Pool from the
date of such loan until such principal amount shall be paid in full.

(a)    
          If only funds from Internal Sources comprise the funds available in the
          Non-Regulated Subsidiary Money Pool, the interest rate applicable to loans of
          such funds from Internal Sources shall be the CD yield equivalent of the 30-day
          Federal Reserve AA Non-Financial Commercial Paper Composite Rate
          (the Composite Rate) (or, if no such Composite Rate is established
          for that day, then the applicable rate shall be the Composite Rate for the next
          preceding day for which such Composite Rate was established).

(b)    
          If only funds from External Sources comprise the funds available in the
          Non-Regulated Subsidiary Money Pool, the interest rate applicable to loans of
          such funds from External Sources shall be equal to the lending Partys cost
          for such funds from External Sources (or, if more than one Party had made
          available funds from External Sources on such day, the applicable interest rate
          shall be a blended rate, equal to the weighted average of the cost incurred by
          the respective Parties for such funds from External Sources).

(c)    
          In cases where funds from both Internal Sources and External Sources are
          concurrently borrowed through the Non-Regulated Subsidiary Money Pool, the rate
          applicable to all loans comprised of such blended funds shall be a
          blended rate, equal to the weighted average of the (i) cost of all funds
          contributed by Parties from Internal Sources (as determined pursuant to Section
          1.5(a) above) and (ii) the cost of all such funds from External Sources (as
          determined pursuant to Section 1.5(b) above); provided, that, notwithstanding
          Section 1.3(b) of this Agreement, in circumstances where funds from Internal
          Sources and External Sources are available for loans through the Non-Regulated
          Subsidiary Money Pool, loans may be made exclusively with funds from Internal
          Sources or External Sources, rather than from a blend of such funds,
          to the extent it is expected that such loans would result in a lower cost of
          borrowing.

Section
1.6 Certain Costs. The cost of compensating balances and/or fees paid to banks or
other institutions to maintain credit facilities by Parties contributing funds from
External Sources to the Non-Regulated Subsidiary Money Pool shall initially be paid by the
Party maintaining such facilities. A portion of such costs shall periodically be allocated
to the Parties borrowing such funds from External Sources through the Non-Regulated
Subsidiary Money Pool on a fair and equitable basis.

Section
1.7 Repayment. Each Party receiving a loan hereunder shall repay the principal
amount of such loan, together with all interest accrued thereon, on demand and in any
event within one year of the date on which such loan was made. All loans made through the
Non-Regulated Subsidiary Money Pool may be prepaid by the borrowing Party without premium
or penalty.

4

Section
1.8 Form of Loans to Parties. Loans to Parties through the Non-Regulated Subsidiary
Money Pool will be made pursuant to open-account advances, repayable upon demand;
provided, that each Party contributing funds shall at all times be entitled to receive
upon demand one or more promissory notes evidencing any and all loans made by the
Non-Regulated Subsidiary Money Pool. Any such note shall: (a) be dated as of the date of
the initial borrowing, (b) mature on demand or on a date agreed to by the Parties to the
transaction, but in any event not later than one year after the date of the applicable
borrowing, and (c) be prepayable in whole at any time or in part from time to time,
without premium or penalty.

ARTICLE IIOPERATION OF
NON-REGULATED SUBSIDIARY MONEY POOL

Section
2.1 Operation. Operation of the Non-Regulated Subsidiary Money Pool, including
record keeping and coordination of contributions and loans, will be handled by Ameren
Services under the authority of the appropriate officers of the Parties. Ameren Services
shall be responsible for the determination of all applicable interest rates and charges to
be applied to contributions to and loans from the Non-Regulated Subsidiary Money Pool at
any time hereunder, shall maintain records of all such contributions and loans, interest
charges and accruals and interest and principal payments for purposes hereof, and shall
prepare periodic reports thereof for the Parties. Ameren Services will administer the
Non-Regulated Subsidiary Money Pool on an at cost basis. Separate records
shall be kept by Ameren Services for the Non-Regulated Subsidiary Money Pool established
by this Agreement and any other money pool administered by Ameren Services.

Section
2.2 Investment of Surplus Funds in the Non-Regulated Subsidiary Money Pool. Funds
not required to meet Non-Regulated Subsidiary Money Pool loans (with the exception of
funds required to satisfy the Non-Regulated Subsidiary Money Pools liquidity
requirements) will ordinarily be invested in one or more short-term investments,
including: (i) interest-bearing accounts with banks; (ii) obligations issued or guaranteed
by the U.S. government and/or its agencies and instrumentalities, including obligations
under repurchase agreements; (iii) obligations issued or guaranteed by any state or
political subdivision thereof, provided that such obligations are rated not less than A by
a nationally recognized rating agency; (iv) commercial paper rated not less than A-1 or
P-1 or their equivalent by a nationally recognized rating agency; (v) money market funds;
(vi) bank certificates of deposit and bankers acceptances; (vii) Eurodollar certificates
of deposit or time deposits; (viii) investment grade medium term notes, variable rate
demand notes and variable rate preferred stock; and (ix) such other investments as are
permitted by Section 9(c) of the Act and Rule 40 thereunder.

Section
2.3 Allocation of Interest Income and Investment Earnings. The interest income and
other investment income earned by the Non-Regulated Subsidiary Money Pool on loans to
Parties and on investment of surplus funds will be allocated among the

5

Parties making
contributions in accordance with the proportion each Partys contribution of funds to
the Non-Regulated Subsidiary Money Pool bears to the total amount of funds contributed to
the Non-Regulated Subsidiary Money Pool and the cost of any External Sources contributed
to the Non-Regulated Subsidiary Money Pool by such Party. Interest and other investment
earnings will be computed on a daily basis and settled once per month.

Section
2.4 Event of Default. If any Party shall generally not pay its debts as such debts
become due, or shall admit in writing its inability to pay its debts generally, or shall
make a general assignment for the benefit of creditors, or any proceeding shall be
instituted by or against any Party seeking to adjudicate it a bankrupt or insolvent, then
the other Parties may declare the unpaid principal amount of any loans to such Party, and
all interest thereon, to be forthwith due and payable and all such amounts shall forthwith
become due and payable.

ARTICLE IIIMISCELLANEOUS

Section
3.1 Amendments, Waivers. Except as provided for in Section 1.2(b), this Agreement
may not be modified or amended in any respect except in writing executed by the Parties.
No provision of this Agreement shall be deemed waived unless such wavier is set forth in
writing and executed by the Party making such waiver.

Section
3.2 Legal Responsibility. Nothing herein contained shall render any Party liable
for the obligations of any other Party hereunder and the rights, obligations and
liabilities of the Parties are several in accordance with their respective obligations,
and not joint.

Section
3.3 Governing Law. This Agreement shall be governed by, and construed in accordance
with, the laws of the State of Missouri.

6

IN
WITNESS WHEREOF, the undersigned companies have duly caused this Agreement to be signed on
their behalf on the date first written above by the undersigned thereunto duly authorized.

| |  | AMEREN CORPORATIONBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -----------------------------------------------------------------------------------------------------------------------

| |  | AMEREN SERVICES COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ----------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN ENERGY, INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN DEVELOPMENT COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -------------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN ERC, INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ---------------------------------------------------------------------------------------------------------------------

7

| |  | CIPSCO INVESTMENT COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   President
| |  | -----------------------------------------------------------------------------------------------------------

| |  | UNION ELECTRIC DEVELOPMENT CORPORATIONBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -------------------------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN ENERGY COMMUNICATIONS, INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ---------------------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN ENERGY RESOURCES COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ------------------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN ENERGY GENERATING COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -------------------------------------------------------------------------------------------------------------------------------------

8

| |  | AMEREN ENERGY DEVELOPMENT COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | --------------------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN ENERGY MARKETING COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ------------------------------------------------------------------------------------------------------------------------------------

| |  | AMEREN ENERGY FUELS AND SERVICES COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ---------------------------------------------------------------------------------------------------------------------------------------------

| |  | AFS DEVELOPMENT COMPANY, LLCBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Treasurer
| |  | --------------------------------------------------------------------------------------------------------------

| |  | ILLINOIS MATERIALS SUPPLY CO.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ----------------------------------------------------------------------------------------------------------------------------------

9

| |  | CILCORP INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -----------------------------------------------------------------------------------------------------------------

| |  | CENTRAL ILLINOIS GENERATION, INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | --------------------------------------------------------------------------------------------------------------------------------------

| |  | CILCORP INVESTMENT MANAGEMENT INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   President
| |  | --------------------------------------------------------------------------------------------------------------------

| |  | CILCORP VENTURES INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | --------------------------------------------------------------------------------------------------------------------------

| |  | QST ENTERPRISES INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Treasurer
| |  | ------------------------------------------------------------------------------------------------------

10

| |  | CILCORP ENERGY SERVICES INC.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ---------------------------------------------------------------------------------------------------------------------------------

| |  | CILCO EXPLORATION AND DEVELOPMENT COMPANYBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   President
| |  | ---------------------------------------------------------------------------------------------------------------------------

| |  | CILCO ENERGY CORPORATIONBy: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   President
| |  | ----------------------------------------------------------------------------------------------------------

| |  | AMERENENERGY MEDINA VALLEY COGEN (NO. 4), L.L.C.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -----------------------------------------------------------------------------------------------------------------------------------------------------

| |  | AMERENENERGY MEDINA VALLEY COGEN, L.L.C.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | ---------------------------------------------------------------------------------------------------------------------------------------------

11

| |  | AMERENENERGY MEDINA VALLEY COGEN (NO. 2), L.L.C.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -----------------------------------------------------------------------------------------------------------------------------------------------------

| |  | AMERENENERGY VALLEY OPERATIONS, L.L.C.By: /s/ Jerre E. Birdsong
Name:  Jerre E. BirdsongTitle:   Vice President and Treasurer
| |  | -------------------------------------------------------------------------------------------------------------------------------------------

12