meanwhile , he worked with mario to plan how they might retake san gimignano and free its citizens from the cruel yoke of the templars , but they had learned a lesson from the last time , and maintained an iron grip on the city .