Refactorig config struct