Refactor triplets.