Config refactoring and cleanup