Refactoring and adding of config