 There were approximately 1500 counties in China proper.This economic structure was later modified by commercial towns in the Middle Ages.A county was controlled by a magistrate in a walled complex in the walled county center.