renamed config to settings to resolve naming conflict
refactoring related bug fixes