Tarnów remained in the hands of the Leliwa family, out of which in the 15th century the Tarnowski family emerged. In the 14th century, numerous German settlers immigrated from Kraków and Nowy Sącz (see Walddeutsche, Ostsiedlung). During the 17th century Scottish immigrants began to come in large numbers. In 1528 the exiled King of Hungary János Szapolyai lived in the town. The town prospered during the Polish Golden Age, when it belonged to Hetman Jan Tarnowski (1488–1561). In the mid-16th century, its population was app. 1,200, with 200 houses located within town's defensive wall (the wall itself had been built in the mid-15th century, and expanded in the early 16th century). In 1467, the waterworks and sewage systems were completed, with large cisterns filled with drinking water built in the main market square. In the 16th century, during the period known as the Polish Golden Age, Tarnów had a school, a synagogue, a Calvinist prayer house, Roman Catholic churches, and up to twelve guilds.