repair code structure