gathering of the Russian lands). Court The court of the Moscow princes combined ceremonies and customs inherited from Kievan Rus' with those imported from the Byzantine Empire and Golden Horde. Some traditional Russian offices, like that of tysyatsky and veche, were gradually abolished in order to consolidate power in the hands of the ruling prince. A new elaborate system of court precedence, or mestnichestvo, predicated the nobleman's rank and function on the rank and function of his ancestors and other members of his family. The highest echelon of hereditary nobles was composed of boyars. They fell into three categories: Rurikid princes of Upper Oka towns, Suzdal, Rostov, Yaroslavl, etc. that lived in Moscow after their hereditary principalities had been incorporated into Duchy of Moscow (e.g., Shuisky, Vorotynsky, Repnin, Romodanovsky); Foreign princes from Lithuania and Golden Horde, claiming descent either from Grand Duke Gediminas (e.g., Belsky, Mstislavsky, Galitzine, Trubetskoy) or from Genghis Khan; Ancient families of Moscow nobility that have been recorded in the service of Grand Dukes from the 14th century (e.g., Romanov, Godunov, Sheremetev). Rurikid and Gediminid boyars, whose fathers and grandfathers were independent princelings, felt that they were kin to the grand prince and hence almost equal to him. During the times of dynastic troubles (such as the years of Ivan IV's minority), boyardom constituted an internal force that was a permanent threat to the throne. An early form of the monarch's conflict with the boyars was the oprichnina policy of Ivan the Terrible. During such conflicts, Ivan, Boris Godunov, and some later monarchs felt the necessity to counterbalance the boyardom by creating a new kind of nobility, based on personal devotion to the tsar and merits earned by faithful service, rather than by heredity. Later these new nobles were called dvoryans (singular: dvoryanin). The name comes from the Russian word dvor, meaning tsar's dvor, i.e., The Court. Hence the expression pozhalovat ko dvoru, i.e., to be called to (serve) The Court. Relations with the Horde Relations between the Moscow principality and the Horde were mixed. In the first two decades of the 13th century Moscow gained the support of one of the rivaling Mongol statesmen, Nogai, against the principalities that were oriented towards Sarai khans. After the restoration of unity in the Golden Horde in the early 14th century, it generally enjoyed the favor of khans until 1317, but lost it in 1322–1327. The following thirty years,