Clean up back-end code for saving value sets