at the time it had been necessary to concentrate their forces in the city to make certain the occupation , so a series of small forts were built several leagues to the east of the city as a first defence against any attack from the moors .