Triples code cleanup