Refactored the code to be able to get and set the whole config at once. Also added comments.