config; partial refactor of repair code