Add better triplet parsing