Refactor the executeConfigComponents method.

After adding the hook handling it had become way too ugly.

It still needs some love, but at least we have gained some readability.