Refactoring and adding creation of config files