Configuration file. Some cleaning and refactoring.