split into two methods. Isn’t that duplicating code?
Sometimes the implementation of both methods indeed looks very similar. It is split into two methods to ensure that the implementation will either take over the full set of new settings, or reject them entirely. It would be dreadful, if, during load settings part of the settings would be taken over (by assigning them to the internal variables), just to realize half way through that some values are invalid – and then ending it with an exception. Separating the validation step from the assigning (loading) step adds robustness to the application.