General cleanup before configuration changes