Refactor config file parse.