Saving changes in variant sets connections.
Code refactored.