Uses CConfig. Better config parsing. Refactor.