Gioseffo Zarlino, a composer, author, and theorist in the Renaissance, was one of the first to distinguish between the two types of imitative counterpoint: fugues and canons (which he called imitations). Originally, this was to aid improvisation, but by the 1550s, it was considered a technique of composition. The composer Giovanni Pierluigi da Palestrina (1525?–1594) wrote masses using modal counterpoint and imitation, and fugal writing became the basis for writing motets as well. Palestrina's imitative motets differed from fugues in that each phrase of the text had a different subject which was introduced and worked out separately, whereas a fugue continued working with the same subject or subjects throughout the entire length of the piece.