Set config file and major refactor