The earliest organization into "județe" of the Principalities of Wallachia, respectively "ținuturi" of Moldavia, dates back at least to the late 14th century. Each "județ", respectively "ținut", was ruled by a "jude", respectively "pârcălab", an officially appointed person who had administrative and judicial functions in a manner inspired from the organization of the late Byzantine Empire. Transylvania, when it was part of the historic Kingdom of Hungary (in the Middle Ages), an independent Principality or a Habsburg domain (in the modern era until World War I) was divided into royal counties (Latin: "comitatus"), headed by "comes" (royal counts) with administrative and judicial functions. The term "județ" started to be used in Romanian as a general term for all administrative divisions since the mid 19th century.