The term derives from their service in the sacrum cubiculum, the emperor's "sacred bedchamber". In the late Roman period, the cubicularii or koubikoularioi were numerous: according to John Malalas, Empress Theodora's retinue numbered as many as 4,000patrikioi and koubikoularioi. They were placed under the command of the praepositus sacri cubiculi and the primicerius sacri cubiculi, while the other palace servants came either under the castrensis sacri palatii or the magister officiorum. There were also specialcubicularii/koubikoularioi for the empress, and the office was introduced into the Roman Church as well, probably under Pope Leo I. In Byzantium, they played a very important role, holding senior palace offices such as parakoimōmenos or the epi tēs trapezēs, but also served in posts in the central financial departments, as provincial administrators and sometimes even as generals. Gradually, in the 7th-8th centuries, the eunuchs of the imperial bedchamber proper were separated from the other koubikoularioi and, distinguished as the koitōnitai, came under the authority of the parakoimōmenos. At the same time, the imperial wardrobe and its officials also became a separate department under the prōtovestiarios. The remainder continued as the "koubikoularioi of the kouboukleion", still under the praepositus, with the primicerius continuing as his chief aide. The office was eventually abandoned by the Byzantines, but it is not clear when: Nikolaos Oikonomides suggested the latter half of the 11th century, but Rodolphe Guilland supported its continued existence until the early 13th century. By the 9th century, aside from its general use denoting a eunuch palace servant, koubikoularios had also acquired a more technical meaning as a grade or dignity in the Byzantine palace hierarchy: according to the Klētorologion of 899, the rank of koubikoularios was the second-lowest among those reserved for the eunuchs, coming after the spatharokoubikoularios and before the nipsistiarios. Again according to the Klētorologion, the distinctive insignia of the rank were a kamision edged with purple, and a paragaudion.