I'd pull this whole self.create_from_json block into a separate Module and mix it in to the four agents that use it (assuming I'm reading right that it's identical across the four files)