more config refactoring. resonably stable