Refactoring config part out of main script