Section 22E. Any utility organized and existing under the laws of or doing business in this commonwealth and any municipality may enter into, and from time to time amend, and perform a cooperation agreement pursuant to which (a) the utility shall pay to the municipality in each calendar year for a period of years specified in such agreement an amount which shall be not less than two per cent of such utility's gross revenue or in the case of a distribution company as defined in section 1 of chapter 164, 7 per cent of retail delivery revenues derived during the next preceding calendar year from its customers in said municipality and (b) the municipality shall expend during such term as such agreement may specify an amount not exceeding the sums paid to it by the utility pursuant to such agreement to remove (or cause to be removed) any poles and overhead wires and associated overhead structures of such utility and, if needed for the continuation of such utility's service, to replace the same (or cause them to be replaced) with underground facilities. In carrying out its obligations under any such cooperation agreement, a municipality may exercise all of its powers appurtenant to the performance of any public work and may award contracts in the same manner and subject to the same limitations and restrictions as would apply to like contracts in reference to the planning or performance of any public work. Such cooperation agreement may contain any and all such provisions as shall be consistent with the purposes of this section, including a provision that the municipality shall expend a portion of the sums paid to it by the utility for the provision of customer's service facilities.