split config code into three files