Restructure configuration building for better code readability