In 1304, William I, the second son of John Avesnes, succeeded his father and took the title of Count of Hainaut: he was nicknamed "the Good" and married, on 19 May 1305, Joan of Valois (1294-1352), sister of the king of France, Philip VI of France: The couple lived in Le Quesnoy frequently. The count in 1314, improved and strengthened the fortifications and, in 1318, in order to promote trade, he allowed wealthy Lombard bankers to settle in the town. In 1327 Philippa of Hainault, his was asked for her hand in marriage by King Edward III of England: the marriage was celebrated in 1328 in York, (England). At that time, William of Hainault had an excellent relationship with Flanders, England and France.