Refactor create config file