A municipality may withdraw one or more departments from the retirement system established by this part by the procedure provided in § 7-427 for acceptance of this part; provided such withdrawal shall not relieve the municipality from liability arising from retirement allowances already granted. The employees of the department or departments shall be entitled to the return of their contributions, plus interest as provided in § 7-440, and the same shall be paid to the municipality for that purpose. In addition, the municipality shall be entitled to receive any balance from the sums contributed by it for such department or departments after deducting any payments already made or then due on account of administrative expenses and retirement allowances, with a sum sufficient, as determined by the commission on sound actuarial principles, to provide for the payment of all future retirement allowances and refunds already vested by the retirement of members from the municipality. For this purpose, such retirement allowances and future retirement allowances shall exclude an amount equal to the total contributions, plus interest as provided in § 7-440, of members previously retired under this part. If there is a deficit in such sum, it shall be paid in full into the fund by the municipality seeking to withdraw and its liability in this regard shall be enforceable as provided in § 7-445.