More config parsing and refactor...