Some refactoring in configuration