How did building codes help to improve the safety of urban tenements