 Tribal customs were retained after Aguda united the Jurchen tribes and formed the Jin dynasty, coexisting alongside more centralised institutions.The Jin dynasty had five capitals, a practice they adopted from the Balhae and the Liao.The Jin had to overcome the difficulties of controlling a multi-cultural empire composed of territories once ruled by the Liao and Northern Song.