Optimize configuration setting and loading