Refactoried the config part