More continued refactoring related to config changes. Work in progress..