refactoring config code to achieve greater simplicity of localConf and readability of code