Original: Originally there were two courtyards inside and residential buildings against the walls.
Simplified: There were two courtyards inside and houses against the walls.