refactored applyconfig to be private