some refactoring on configuration files handling.